<?php
include_once '../Config/config.php';
include_once '../Config/conexion.php';
include_once '../Model/Pais.php';
include_once '../Model/Revisor.php';

$titulo_page = 'Subir Papers';
include_once '../Shared/header.php';

if(isset($_GET["idrevisor"])){
	$revisor_id = $_GET["idrevisor"];
	$revisor = Revisor::ObtenerRevisorPorIdRevisor($revisor_id);	
	}
	else{
	$revisor = new Revisor(Null);	
	}
?>

<script type="text/javascript" src="validacion.js"></script>
<div class="container">
	<?php $tituloMenu  = "Nuevo Revisor";?>
	<?php include_once '../Shared/Menu.php'?>
</div>
<div class="container">
<fieldset><legend>Ingrese sus datos:</legend>
<form action="Proceso.php" method="post" enctype="multipart/form-data" onsubmit="return validacion()">
<input type="hidden" name="revisor_id" value="<?php echo $revisor->revisor_id?>">
<input type="hidden" name="usuario_id" value="<?php echo $revisor->usuario_id?>">
	<div class="span-20 last">
		<div class="span-5">
		Usuario
		</div>
		<div class="span-15 last">
		<input type="text" name="usuario" id="usuario" value="<?php echo $revisor->usuario?>"/>
		</div>
	</div>
	<div class="span-20 last">
		<div class="span-5">
		Contrase&ntilde;a
		</div>
		<div class="span-15 last">
		<input type="text" name="contrasena" id="contrasena" value="<?php echo $revisor->contrasena?>"/>
		</div>
	</div>
	<div class="span-20 last">
		<div class="span-5">
		Nombre Completo
		</div>
		<div class="span-15 last">
		<input type="text" name="revisor" id="revisor" value="<?php echo $revisor->revisor?>"/>
		</div>
	</div>
	

	
	<div class="span-20 last">
		<div class="span-5">
		Pa&iacute;s
		</div>
		<div class="span-15 last">
		<?php $listaPais = Pais::ListarPaises();?>
		<select name="pais" id="pais">
        		<option value="">Seleccione Pa&iacute;s</option>
			<?php				
				foreach($listaPais as $key => $value){
				?>
					<option value="<?php echo $value->nombre?>"
						<?php 
							if($value->nombre == $revisor->pais){
								echo 'selected="selected"';
							}
						?>
					><?php echo $value->nombre?></option>
						
				<?php				
				}
			?>
		</select>
		</div>
	</div>	

	<div class="span-20 last">
		<div class="span-5">
		Email
		</div>
		<div class="span-15 last">
		<input type="text" name="email" id="email" value="<?php echo $revisor->email?>"/>
		</div>
	</div>

	<div class="span-20 last">
		<div class="span-5">
		Instituci&oacute;n
		</div>
		<div class="span-15 last">
		<input type="text" name="institucion" id="institucion" value="<?php echo $revisor->institucion?>"/>
		</div>
	</div>	
	

	<div class="span-20 last">
		<input type="submit" value="Enviar">
	</div>
</form>
</fieldset>
</div>
<?php 
include_once '../Shared/footer.php';
?>
